package com.hxd.mall.module.common;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.hxd.mall.module.MainActivity;

public class StartAppReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equalsIgnoreCase("install_and_start")) {
            Intent intent2 = new Intent(context, MainActivity.class);
            //注意,不能少
            intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent2);
        }
    }

}